import request from '@/utils/request';

// 类目列表
export const catalogList = (data) => {
  return request({
    url: '/console/type/index',
    method: 'POST',
    data,
  })
}
// 获取子分类
export const catalogChildList = (data) => {
  return request({
    url: '/console/type/childNote',
    method: 'POST',
    data,
  })
}
// 获取子分类
export const getTopLastestType = (data) => {
  return request({
    url: '/console/type/getTopLastestType',
    method: 'POST',
    data,
  })
}
// （添加/更新）（分类/子分类）
export const catalogSave = (data) => {
  return request({
    url: '/console/type/save',
    method: 'POST',
    data,
  })
}
// 修改状态
export const catalogUpdateState = (data) => {
  return request({
    url: '/console/type/updateState',
    method: 'POST',
    data,
  })
}
// 品牌列表
export const brandList = (data) => {
  return request({
    url: '/console/brand/getList',
    method: 'POST',
    data,
  })
}
// 添加、更新品牌
export const brandSave = (data) => {
  return request({
    url: '/console/brand/save',
    method: 'POST',
    data,
  })
}
// 禁用、启用品牌
export const brandState = (data) => {
  return request({
    url: '/console/brand/updateState',
    method: 'POST',
    data,
  })
}
// 品牌列表导出
export const brandExport = (data) => {
  return request({
    url: '/console/brand/export',
    method: 'POST',
    data,
    responseType: 'blob',
  })
}
// 商品基类列表
export const goodsBaseList = (data) => {
  return request({
    url: '/console/baseGoods/index',
    method: 'POST',
    data,
  })
}
// 添加、修改商品
export const goodsSave = (data) => {
  return request({
    url: '/console/baseGoods/save',
    method: 'POST',
    data,
  })
}
// 导出商品
export const exportBaseGoods = (data) => {
  return request({
    url: '/console/baseGoods/export',
    method: 'POST',
    responseType: 'blob',
    data,
  })
}
// 禁用、启用商品
export const changeBaseGoodsState = (data) => {
  return request({
    url: '/console/baseGoods/state',
    method: 'POST',
    data,
  })
}
// 热搜
export const getHotBrandList = (data) => {
  return request({
    url: '/console/brand/getHotBrandList',
    method: 'POST',
    data,
  })
}
// 
export const getHotBrandByTypeId = (data) => {
  return request({
    url: '/console/brand/getHotBrandByTypeId',
    method: 'POST',
    data,
  })
}
// 获取指定类目下的品牌
export const getBrandByTypeId = (data) => {
  return request({
    url: '/console/brand/getBrandByTypeId',
    method: 'POST',
    data,
  })
}
// 编辑热销
export const editHotBrand = (data) => {
  return request({
    url: '/console/brand/editHotBrand',
    method: 'POST',
    data,
  })
}
